<?xml version="1.0" encoding="utf-8" ?>
<wk:arctype type='self'>
<current field='typeid'>
<content Name="<field name='typename' />">
</current>
</wk:arctype>
<wk:arctype type='son' field="id,fid,description,litpic">
<?php 
	$id = $_field['id'];
	$sql = "SELECT * FROM `".C('DB_PREFIX')."addondiyinfo` WHERE `typeid`='$id'";
	$query = mysql_query($sql);
	while($row=mysql_fetch_array($query)){
	$count=mysql_num_rows($query);
}
?>
<gallery Name="<field name='typename' /> (<?php echo $count; ?>)">
<wk:arclist typeid='~typeid~' paging='0' getall='1'>
<?php 
	$id = $_field['id'];
	$sql = "SELECT * FROM `".C('DB_PREFIX')."addondiyinfo` WHERE `id`='$id'";
	$query = mysql_query($sql);
	while($row=mysql_fetch_array($query)){
	$topic = $row[topic];
	$body = $row[body];
	$simg  = $row[simg];
	$url = $row[url];
	$open  = $row[open];
	$img  = $row[img];
	$ywidth  = $row[ywidth];
	$yheight  = $row[yheight];
}
?>
<item Image="<?php echo $img; ?>">
<description><![CDATA[<?php echo $body; ?>]]></description>
<url><?php echo $url; ?></url>
<title><field name='title' function="cn_substr(@me,0,38,false)"/></title>
</item>
</wk:arclist>
</gallery>
</wk:arctype>
</content>